package com.lmiot.xyclick.Activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.TextView;
import com.lmiot.xyclick.Util.SpFlag;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Bean.NewBean.PayResBean;
import com.lmiot.xyclick.Bean.NewBean.WxPayResBean;
import com.lmiot.xyclick.Bean.XyNoticBean;
import com.lmiot.xyclick.KeYi.HttpUtilXYPro;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Share.Bean.VipSupportBean;
import com.lmiot.xyclick.Util.ActivityUtil;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.DebugUtli;
import com.lmiot.xyclick.Util.FileUtils;
import com.lmiot.xyclick.Util.HttpUtilNew;
import com.lmiot.xyclick.Util.LogUtil;
import com.lmiot.xyclick.Util.PhoneUtil;
import com.lmiot.xyclick.Util.TimeUtils;
import com.lmiot.xyclick.View.MyGridView;
import com.lmiot.xyclick.inteface.OnBasicListener;
import com.xiaoyi.intentsdklibrary.SDK.Action.ActionNormalSDK;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;
import com.youyi.yyviewsdklibrary.View.TitleBarView;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.builder.GetBuilder;
import com.zhy.http.okhttp.callback.FileCallBack;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class PayVIPActivity extends BaseActivity implements View.OnClickListener {
    private static final String TAG = "PayVIPActivity";
    private LinearLayout mBtPayServer;
    LinearLayout mIdBtPay;
    MyGridView mIdGridview;
    TextView mIdMoney;
    TextView mIdMoney02;
    TextView mIdMoney02Name;
    TextView mIdMoney02Old;
    TextView mIdMoney03;
    TextView mIdMoney03Name;
    TextView mIdMoney03Old;
    TextView mIdMoney04;
    TextView mIdMoney04Name;
    TextView mIdMoney04Old;
    LinearLayout mIdPayEver;
    LinearLayout mIdPayMonth;
    LinearLayout mIdPayYear;
    LinearLayout mIdTipLayout;
    TextView mIdTipMsg;
    TitleBarView mIdTitleBar;
    ImageView mIdWxChose;
    LinearLayout mIdWxLayout;
    ImageView mIdZfbChose;
    LinearLayout mIdZfbLayout;
    private boolean mIsWx;
    private String mLevel = "year";
    private int mPayMoneyNum;
    private int mSecondPayType;

    /* access modifiers changed from: protected */
    @Override // android.support.v4.app.SupportActivity, com.lmiot.xyclick.Activity.BaseActivity, android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_pay);
        initView();
//        if (!EventBus.getDefault().isRegistered(this)) {
//            EventBus.getDefault().register(this);
//        }
//        this.mIdTitleBar.setOnItemClickListener(new TitleBarView.onItemClickListener() {
//            /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass1 */
//
//            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
//            public void onMenuClick(View view) {
//            }
//
//            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
//            public void onTitleClick(View view) {
//            }
//
//            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
//            public void onBackClick(View view) {
//                PayVIPActivity.this.finish();
//            }
//        });
//        if (DataUtil.getLoginByWx(MyApp.getContext())) {
//            this.mIdTipLayout.setVisibility(View.VISIBLE);
//        } else if (DebugUtli.isDebugVersion(MyApp.getContext())) {
//            this.mIdTipLayout.setVisibility(View.VISIBLE);
//        } else {
//            this.mIdTipLayout.setVisibility(View.GONE);
//        }
//        showGridView();
//        showMoney();
    }

    private void showMoney() {
        if (DataUtil.nowNoicBean != null) {
            showData();
        } else {
            downNotic(new OnBasicListener() {
                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass2 */

                @Override // com.lmiot.xyclick.inteface.OnBasicListener
                public void result(boolean z, String str) {
                    if (z) {
                        PayVIPActivity.this.showData();
                        return;
                    }
                    ToastUtil.err("数据请求出错，请重启APP或检查网络！");
                    PayVIPActivity.this.finish();
                }
            });
        }
    }

    private void downNotic(final OnBasicListener onBasicListener) {
//        File filesDir = MyApp.getContext().getFilesDir();
//        LogUtil.d(TAG, "downNotic=" + "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/noticText.txt");
//        ((GetBuilder) OkHttpUtils.get().url("https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/noticText.txt")).build().connTimeOut(15000).writeTimeOut(15000).readTimeOut(15000).execute(new FileCallBack(filesDir.getAbsolutePath(), "nt.xy") {
//            /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass3 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void inProgress(float f, long j) {
//            }
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                LogUtil.d(PayVIPActivity.TAG, "downNotic=错误");
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//            }
//
//            public void onResponse(File file) {
//                if (file != null) {
//                    try {
//                        String readFileToString = FileUtils.readFileToString(file);
//                        LogUtil.d(PayVIPActivity.TAG, "downNotic=成功：" + readFileToString);
//                        XyNoticBean xyNoticBean = (XyNoticBean) new Gson().fromJson(readFileToString, XyNoticBean.class);
//                        if (xyNoticBean != null) {
//                            DataUtil.nowNoicBean = xyNoticBean;
//                        }
//                        if (onBasicListener != null) {
//                            onBasicListener.result(true, "");
//                        }
//                    } catch (Exception e) {
//                        e.printStackTrace();
//                        OnBasicListener onBasicListener2 = onBasicListener;
//                        if (onBasicListener2 != null) {
//                            onBasicListener2.result(false, "");
//                        }
//                    }
//                } else {
//                    OnBasicListener onBasicListener3 = onBasicListener;
//                    if (onBasicListener3 != null) {
//                        onBasicListener3.result(false, "");
//                    }
//                }
//            }
//        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void showData() {
        int pay_type = DataUtil.nowNoicBean.getPay_type();
        this.mSecondPayType = pay_type;
        if (pay_type == 0) {
            this.mIdZfbLayout.setVisibility(View.VISIBLE);
            this.mIdWxLayout.setVisibility(View.VISIBLE);
            this.mIdWxChose.setVisibility(View.GONE);
            this.mIdZfbChose.setVisibility(View.VISIBLE);
            this.mIsWx = false;
        } else if (pay_type == 1) {
            this.mIdZfbLayout.setVisibility(View.GONE);
            this.mIdWxLayout.setVisibility(View.VISIBLE);
            this.mIdWxChose.setVisibility(View.VISIBLE);
            this.mIdZfbChose.setVisibility(View.GONE);
            this.mIsWx = true;
        } else if (pay_type == 2) {
            this.mIdZfbLayout.setVisibility(View.VISIBLE);
            this.mIdWxLayout.setVisibility(View.GONE);
            this.mIdWxChose.setVisibility(View.GONE);
            this.mIdZfbChose.setVisibility(View.VISIBLE);
            this.mIsWx = false;
        } else if (pay_type == 3) {
            this.mIdZfbLayout.setVisibility(View.VISIBLE);
            this.mIdWxLayout.setVisibility(View.VISIBLE);
            this.mIdWxChose.setVisibility(View.GONE);
            this.mIdZfbChose.setVisibility(View.VISIBLE);
            this.mIsWx = false;
        } else if (pay_type == 4) {
            this.mIdZfbLayout.setVisibility(View.VISIBLE);
            this.mIdWxLayout.setVisibility(View.GONE);
            this.mIdWxChose.setVisibility(View.GONE);
            this.mIdZfbChose.setVisibility(View.VISIBLE);
            this.mIsWx = false;
        }
        if (DataUtil.nowNoicBean.getV01() != 0) {
            TextView textView = this.mIdMoney02;
            textView.setText(DataUtil.nowNoicBean.getV02() + "");
            TextView textView2 = this.mIdMoney02Old;
            textView2.setText("原价：" + DataUtil.nowNoicBean.getV02_src() + "");
            TextView textView3 = this.mIdMoney02Old;
            textView3.setPaintFlags(textView3.getPaintFlags() | 16);
            TextView textView4 = this.mIdMoney03;
            textView4.setText(DataUtil.nowNoicBean.getV03() + "");
            TextView textView5 = this.mIdMoney03Old;
            textView5.setText("原价：" + DataUtil.nowNoicBean.getV03_src() + "");
            TextView textView6 = this.mIdMoney03Old;
            textView6.setPaintFlags(textView6.getPaintFlags() | 16);
            TextView textView7 = this.mIdMoney04;
            textView7.setText(DataUtil.nowNoicBean.getV04() + "");
            TextView textView8 = this.mIdMoney04Old;
            textView8.setText("原价：" + DataUtil.nowNoicBean.getV04_src() + "");
            TextView textView9 = this.mIdMoney04Old;
            textView9.setPaintFlags(textView9.getPaintFlags() | 16);
            this.mPayMoneyNum = DataUtil.nowNoicBean.getV03();
            showFinaleMoney();
            return;
        }
        ToastUtil.err("数据请求出错，请联系管理员！");
        finish();
    }

    private void showFinaleMoney() {
        if (this.mIsWx) {
            TextView textView = this.mIdMoney;
            textView.setText("¥" + (this.mPayMoneyNum + 1));
            return;
        }
        TextView textView2 = this.mIdMoney;
        textView2.setText("¥" + this.mPayMoneyNum);
    }

    private void showGridView() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new VipSupportBean("解锁所有功能", R.drawable.s_lock));
        arrayList.add(new VipSupportBean("支持本地备份", R.drawable.s_yun));
        arrayList.add(new VipSupportBean("去启动页广告", R.drawable.s_ad));
        arrayList.add(new VipSupportBean("支持分享动作", R.drawable.auto_share));
        arrayList.add(new VipSupportBean("支持设备管理", R.drawable.s_group));
        arrayList.add(new VipSupportBean("支持更多权益", R.drawable.s_more));
        this.mIdGridview.setAdapter((ListAdapter) new MyAdapter(arrayList));
    }

    private void initView() {
        this.mIdTitleBar = (TitleBarView) findViewById(R.id.id_title_bar);
        this.mIdTipMsg = (TextView) findViewById(R.id.id_tip_msg);
        this.mIdTipLayout = (LinearLayout) findViewById(R.id.id_tip_layout);
        this.mIdMoney02 = (TextView) findViewById(R.id.id_money02);
        this.mIdMoney02Old = (TextView) findViewById(R.id.id_money02_old);
        this.mIdMoney02Name = (TextView) findViewById(R.id.id_money02_name);
        this.mIdPayMonth = (LinearLayout) findViewById(R.id.id_pay_month);
        this.mIdMoney03 = (TextView) findViewById(R.id.id_money03);
        this.mIdMoney03Old = (TextView) findViewById(R.id.id_money03_old);
        this.mIdMoney03Name = (TextView) findViewById(R.id.id_money03_name);
        this.mIdPayYear = (LinearLayout) findViewById(R.id.id_pay_year);
        this.mIdMoney04 = (TextView) findViewById(R.id.id_money04);
        this.mIdMoney04Old = (TextView) findViewById(R.id.id_money04_old);
        this.mIdMoney04Name = (TextView) findViewById(R.id.id_money04_name);
        this.mIdPayEver = (LinearLayout) findViewById(R.id.id_pay_ever);
        this.mIdZfbChose = (ImageView) findViewById(R.id.id_zfb_chose);
        this.mIdZfbLayout = (LinearLayout) findViewById(R.id.id_zfb_layout);
        this.mIdWxChose = (ImageView) findViewById(R.id.id_wx_chose);
        this.mIdWxLayout = (LinearLayout) findViewById(R.id.id_wx_layout);
        this.mIdGridview = (MyGridView) findViewById(R.id.id_gridview);
        this.mIdMoney = (TextView) findViewById(R.id.id_money);
        this.mIdBtPay = (LinearLayout) findViewById(R.id.id_bt_pay);
        this.mBtPayServer = (LinearLayout) findViewById(R.id.bt_pay_server);
        this.mIdTipLayout.setOnClickListener(this);
        this.mIdPayMonth.setOnClickListener(this);
        this.mIdPayYear.setOnClickListener(this);
        this.mIdPayEver.setOnClickListener(this);
        this.mIdZfbLayout.setOnClickListener(this);
        this.mIdWxLayout.setOnClickListener(this);
        this.mIdBtPay.setOnClickListener(this);
        this.mBtPayServer.setOnClickListener(this);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_pay_server /*{ENCODED_INT: 2131296335}*/:
                Intent intent = new Intent(this, WebViewActivity.class);
                intent.putExtra(SpFlag.k, "《会员服务协议》");
                intent.putExtra("url", "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/payserver.html");
                startActivity(intent);
                return;
            case R.id.id_bt_pay /*{ENCODED_INT: 2131296517}*/:
                if (this.mIsWx) {
                    if (!ActionNormalSDK.getInstance().checkPackName(MyApp.getContext(), "com.tencent.mm")) {
                        ToastUtil.warning("请先安装微信！");
                    }
                    HttpUtilNew.getInstance().regist(new OnBasicListener() {
                        /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass4 */

                        @Override // com.lmiot.xyclick.inteface.OnBasicListener
                        public void result(boolean z, String str) {
                            PayVIPActivity.this.startWxPay();
                        }
                    });
                    return;
                }
                if (!ActionNormalSDK.getInstance().checkPackName(MyApp.getContext(), "com.eg.android.AlipayGphone")) {
                    ToastUtil.warning("请先安装支付宝！");
                }
                HttpUtilNew.getInstance().regist(new OnBasicListener() {
                    /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass5 */

                    @Override // com.lmiot.xyclick.inteface.OnBasicListener
                    public void result(boolean z, String str) {
                        PayVIPActivity payVIPActivity = PayVIPActivity.this;
                        payVIPActivity.aliPay(payVIPActivity);
                    }
                });
                return;
            case R.id.id_pay_ever /*{ENCODED_INT: 2131296824}*/:
                this.mIdPayMonth.setBackgroundResource(R.drawable.vipbg01);
                this.mIdPayYear.setBackgroundResource(R.drawable.vipbg01);
                this.mIdPayEver.setBackgroundResource(R.drawable.vipbg01_chose);
                if (DataUtil.nowNoicBean != null) {
                    this.mPayMoneyNum = DataUtil.nowNoicBean.getV04();
                }
                showFinaleMoney();
                this.mLevel = "ever";
                return;
            case R.id.id_pay_month /*{ENCODED_INT: 2131296825}*/:
                this.mIdPayMonth.setBackgroundResource(R.drawable.vipbg01_chose);
                this.mIdPayYear.setBackgroundResource(R.drawable.vipbg01);
                this.mIdPayEver.setBackgroundResource(R.drawable.vipbg01);
                if (DataUtil.nowNoicBean != null) {
                    this.mPayMoneyNum = DataUtil.nowNoicBean.getV02();
                }
                showFinaleMoney();
                this.mLevel = "month";
                return;
            case R.id.id_pay_year /*{ENCODED_INT: 2131296826}*/:
                this.mIdPayMonth.setBackgroundResource(R.drawable.vipbg01);
                this.mIdPayYear.setBackgroundResource(R.drawable.vipbg01_chose);
                this.mIdPayEver.setBackgroundResource(R.drawable.vipbg01);
                if (DataUtil.nowNoicBean != null) {
                    this.mPayMoneyNum = DataUtil.nowNoicBean.getV03();
                }
                showFinaleMoney();
                this.mLevel = "year";
                return;
            case R.id.id_tip_layout /*{ENCODED_INT: 2131296954}*/:
                ActivityUtil.skipActivity(this, OldPayVIPActivity.class);
                return;
            case R.id.id_wx_layout /*{ENCODED_INT: 2131297008}*/:
                this.mIdWxChose.setVisibility(View.VISIBLE);
                this.mIdZfbChose.setVisibility(View.GONE);
                this.mIsWx = true;
                showFinaleMoney();
                return;
            case R.id.id_zfb_layout /*{ENCODED_INT: 2131297019}*/:
                this.mIdWxChose.setVisibility(View.GONE);
                this.mIdZfbChose.setVisibility(View.VISIBLE);
                this.mIsWx = false;
                showFinaleMoney();
                return;
            default:
                return;
        }
    }

    /* access modifiers changed from: private */
    public class MyAdapter extends BaseAdapter {
        List<VipSupportBean> mList;

        public int getCount() {
            return 6;
        }

        public Object getItem(int i) {
            return null;
        }

        public long getItemId(int i) {
            return 0;
        }

        public MyAdapter(List<VipSupportBean> list) {
            this.mList = list;
        }

        public View getView(int i, View view, ViewGroup viewGroup) {
            View inflate = View.inflate(PayVIPActivity.this, R.layout.item_vip, null);
            VipSupportBean vipSupportBean = this.mList.get(i);
            ((TextView) inflate.findViewById(R.id.id_name)).setText(vipSupportBean.getName());
            Glide.with((FragmentActivity) PayVIPActivity.this).load(Integer.valueOf(vipSupportBean.getImg())).into((ImageView) inflate.findViewById(R.id.id_img));
            return inflate;
        }
    }

    public void aliPay(final Context context) {
        String str = this.mLevel;
        str.hashCode();
        char c = 65535;
        switch (str.hashCode()) {
            case 99228:
                if (str.equals("day")) {
                    c = 0;
                    break;
                }
                break;
            case 3125534:
                if (str.equals("ever")) {
                    c = 1;
                    break;
                }
                break;
            case 3704893:
                if (str.equals("year")) {
                    c = 2;
                    break;
                }
                break;
            case 104080000:
                if (str.equals("month")) {
                    c = 3;
                    break;
                }
                break;
        }
        String str2 = "D";
        switch (c) {
            case 1:
                str2 = "E";
                break;
            case 2:
                str2 = "Y";
                break;
            case 3:
                str2 = "M";
                break;
        }
        String payID = TimeUtils.getPayID();
        String str3 = PhoneUtil.getIMEI(context) + "连点器VIP费用_" + str2;
        int i = this.mSecondPayType;
        if (i == 3 || i == 4) {
            String pay_company = DataUtil.nowNoicBean.getPay_company();
            String pay_appid = DataUtil.nowNoicBean.getPay_appid();
            HttpUtilXYPro.getInstance().zfbPay(this.mLevel, (this.mPayMoneyNum * 100) + "", str3, pay_company, pay_appid, new OnBasicListener() {
                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass6 */

                @Override // com.lmiot.xyclick.inteface.OnBasicListener
                public void result(boolean z, String str) {
                    if (z) {
                        PayVIPActivity.this.payByInfo(str);
                    } else {
                        ToastUtil.err(str);
                    }
                }
            });
            return;
        }
//        HttpUtilNew.getInstance().aliPay(payID, str3, "alipay", this.mPayMoneyNum, str3, this.mLevel, new HttpUtilNew.OnPayResultListener() {
//            /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass7 */
//
//            @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnPayResultListener
//            public void result(boolean z, String str, PayResBean.BodyBean.DataBean dataBean) {
//                if (z) {
//                    AliPayTool.aliPay((Activity) context, dataBean, new AliPayTool.OnSuccessAndErrorListener() {
//                        /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass7.AnonymousClass1 */
//
//                        @Override // com.lmiot.xyclick.alipay.AliPayTool.OnSuccessAndErrorListener
//                        public void onSuccess(String str, AliPaySuccesBean aliPaySuccesBean) {
//                            Double.parseDouble(aliPaySuccesBean.getAlipay_trade_app_pay_response().getTotal_amount());
//                            ToastUtil.success("支付成功！");
//                            HttpUtilNew.getInstance().findUserBean(new HttpUtilNew.OnUserBeanListener() {
//                                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass7.AnonymousClass1.AnonymousClass1 */
//
//                                @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnUserBeanListener
//                                public void result(boolean z) {
//                                }
//                            }, new HttpUtilNew.OnOffLine() {
//                                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass7.AnonymousClass1.AnonymousClass2 */
//
//                                @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnOffLine
//                                public void result(boolean z) {
//                                }
//                            });
//                        }
//
//                        @Override // com.lmiot.xyclick.alipay.AliPayTool.OnSuccessAndErrorListener
//                        public void onError(String str) {
//                            ToastUtil.err("支付失败：" + str);
//                        }
//                    });
//                }
//            }
//        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void startWxPay() {
        String str = this.mLevel;
        str.hashCode();
        char c = 65535;
        switch (str.hashCode()) {
            case 99228:
                if (str.equals("day")) {
                    c = 0;
                    break;
                }
                break;
            case 3125534:
                if (str.equals("ever")) {
                    c = 1;
                    break;
                }
                break;
            case 3704893:
                if (str.equals("year")) {
                    c = 2;
                    break;
                }
                break;
            case 104080000:
                if (str.equals("month")) {
                    c = 3;
                    break;
                }
                break;
        }
        String str2 = "D";
        switch (c) {
            case 1:
                str2 = "E";
                break;
            case 2:
                str2 = "Y";
                break;
            case 3:
                str2 = "M";
                break;
        }
        int i = this.mPayMoneyNum + 1;
        String str3 = PhoneUtil.getIMEI(this) + "连点器VIP费用_" + str2;
        HttpUtilNew.getInstance().wxpay("wxa6628a829ecd150f", TimeUtils.getPayID(), str3, "wxpay", i, str3, this.mLevel, new HttpUtilNew.OnWxPayListener() {
            /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass8 */

            @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnWxPayListener
            public void result(boolean z, WxPayResBean wxPayResBean) {
                try {
//                    WxPayResBean.BodyBean.DataBean data = wxPayResBean.getBody().getData();
//                    PayReq payReq = new PayReq();
//                    payReq.appId = data.getAppid();
//                    payReq.partnerId = data.getPartnerid();
//                    payReq.prepayId = data.getPrepayid();
//                    payReq.packageValue = "Sign=WXPay";
//                    payReq.nonceStr = data.getNoncestr();
//                    payReq.timeStamp = data.getTimestamp();
//                    payReq.sign = data.getSign();
//                    MyApp.getInstance().getApi().sendReq(payReq);
                } catch (Exception e) {
                    e.printStackTrace();
                    ToastUtil.err("付款失败，请联系开发者！");
                }
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void payByInfo(final String str) {
//        new Thread() {
//            /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass9 */
//
//            public void run() {
//                super.run();
//                LogUtil.d(PayVIPActivity.TAG, "支付宝付款信息：" + str);
//                Map<String, String> payV2 = new PayTask(PayVIPActivity.this).payV2(str, true);
//                Log.i("msp", payV2.toString());
//                PayResult payResult = new PayResult(payV2);
//                LogUtil.d("PayDemoActivity", "付款结果：" + payResult.getResult() + ":" + payResult.getResultStatus());
//                EventBus.getDefault().post(payResult);
//            }
//        }.start();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent() {
//        String result = payResult.getResult();
//        LogUtil.d(TAG, "支付宝付款结果：" + result);
//        if (TextUtils.equals(payResult.getResultStatus(), "9000")) {
//            ToastUtil.success("支付成功");
//            HttpUtilNew.getInstance().findUserBean(new HttpUtilNew.OnUserBeanListener() {
//                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass10 */
//
//                @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnUserBeanListener
//                public void result(boolean z) {
//                }
//            }, new HttpUtilNew.OnOffLine() {
//                /* class com.lmiot.xyclick.Activity.PayVIPActivity.AnonymousClass11 */
//
//                @Override // com.lmiot.xyclick.Util.HttpUtilNew.OnOffLine
//                public void result(boolean z) {
//                }
//            });
//            return;
//        }
        ToastUtil.err("支付失败");
    }
}
